<?php
header('content-type:text/html;charset=utf8');
$con=mysql_connect('localhost','root','root');
if(!$con){
    die('连接失败'.mysql_error());
}
mysql_select_db('jiaju',$con);
$res=mysql_query('select *from `goodssale`');
if(!$res){
    die('执行失败'.mysql_error);
}
$row=mysql_fetch_assoc($res);
echo json_encode($row);
mysql_close($con);
?>